package com.bw.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ConfigUtil {

    private static Properties properties;

    static {
        configLoader("server.properties");
    }

    public static void configLoader(String propertiesFile) {
        properties = new Properties();
        InputStream in = ConfigUtil.class.getClassLoader().getResourceAsStream(propertiesFile);
        try {
            properties.load(in);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static String getKafkaServer() {
        return properties.getProperty("kafka_server");
    }

    public static String getZookeeperQuorum(){
        return properties.getProperty("hbase.zookeeper.quorum");
    }

    public static String getZookeeperClientPort(){
        return properties.getProperty("hbase.zookeeper.property.clientPort");
    }

}